using UnityEngine;

public class PushBlock_CollisionPrediction : MonoBehaviour
{
	public bool Colliding;

	public bool printresult;

	private void OnTriggerEnter2D(Collider2D other)
	{
		if (!Colliding && ((Component)other).tag != "Player" && ((Component)other).tag != "PuzzlePushBlock")
		{
			Colliding = true;
			if (printresult)
			{
				MonoBehaviour.print((object)((Object)other).name);
			}
		}
	}

	private void OnTriggerStay2D(Collider2D other)
	{
		if (!Colliding && ((Component)other).tag != "Player" && ((Component)other).tag != "PuzzlePushBlock")
		{
			Colliding = true;
		}
		if (printresult)
		{
			MonoBehaviour.print((object)((Object)other).name);
		}
	}

	private void OnTriggerExit2D(Collider2D other)
	{
		if (Colliding && ((Component)other).tag != "Player" && ((Component)other).tag != "PuzzlePushBlock")
		{
			Colliding = false;
		}
		if (printresult)
		{
			MonoBehaviour.print((object)((Object)other).name);
		}
	}

	private void Update()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = default(Vector2);
		((Vector2)(ref val))._002Ector(((Component)PlayerManager.Instance).transform.position.x, ((Component)PlayerManager.Instance).transform.position.y);
		Vector2 val2 = default(Vector2);
		((Vector2)(ref val2))._002Ector(((Component)this).transform.parent.position.x, ((Component)this).transform.parent.position.y);
		Vector2 val3 = val2 - val;
		if (Mathf.Abs(val3.x) > Mathf.Abs(val3.y))
		{
			((Component)this).transform.position = Vector2.op_Implicit(val2 + new Vector2(Mathf.Sign(val3.x), 0f));
		}
		else
		{
			((Component)this).transform.position = Vector2.op_Implicit(val2 + new Vector2(0f, Mathf.Sign(val3.y)));
		}
	}
}
